package com.lms.common.file.config;

import com.lms.common.file.api.utils.IFileUtil;
import com.lms.common.file.utils.FtpFileUtil;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration(proxyBeanMethods = false)
@EnableConfigurationProperties
public class FileConfig {
    @Bean
    @ConditionalOnProperty(name = "file-server.type", havingValue = "ftp")
    public IFileUtil ftp() {
        return new FtpFileUtil();
    }
}
